#include <iostream>
using namespace std;

auto WIDTH{120},HEIGHT{40}; //  window size
auto ball_x{HEIGHT/2}, ball_y{WIDTH/2},
     ball_vec_x{0},ball_vec_y{0};   // ball init pos and speed

//paddle size
auto paddle_w{4},paddle_h{10};

// paddle1 and paddle2 postiong, speed
auto paddle1_x{0},paddle1_y{HEIGHT/2-paddle_h/2},paddle1_vec{3};

auto paddle2_x{WIDTH-paddle_w}
,paddle2_y{HEIGHT/2-paddle_h/2},paddle2_vec{3};

auto score1{0};
auto score2{0};

// 2 draw background
void draw_background(){
    for(int i=0;i<=WIDTH;++i) cout <<"=";
    cout << '\n' ;
    for(int y=0;y<=HEIGHT;++y){
        for(int x=0;x<=WIDTH;++x){
            if( y == ball_x && x == ball_y ) { // position of ball
                cout << "O";
            }
            else if ( x >= paddle1_x && x< paddle_w+paddle1_x
                    && y>=paddle1_y && y <paddle1_y+paddle_h){ // left paddle postion
                cout << 'Z';
            }
            else if ( x >= paddle2_x && x< paddle_w+paddle2_x
                    && y>=paddle2_y && y <paddle2_y+paddle_h){ // right paddle postion
                cout << 'Z';
            }
            else if( x == 0 || x == WIDTH/2 || x == WIDTH ) {
                cout << '|';
            }
            else cout <<' ';
        }
        cout << '\n';
    }
    for(int i=0;i<=WIDTH;++i) cout <<"="; cout << '\n' ;
}
int main(){
    draw_background();
    //cout << ball_x <<" "<< ball_y << endl;
    return 0;
}
